﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CalculatorLib;
using Ninject;

namespace MathClient
{
    class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Calling the WebService with incapsulated dependency creation");
            MathLib lib = new MathLib();
            float circ = lib.ComputeCircumference(3);
            Console.WriteLine(string.Format("The circumference of a circle whose radius is {0} is {1}", 3, circ));
            Console.ReadLine();


            Console.WriteLine("Calling the WebService with Dependency Injection by hand");
            PiWebService ws = new PiWebService();
            lib = new MathLib(ws);
            circ = lib.ComputeCircumference(3);
            Console.WriteLine(string.Format("The circumference of a circle whose radius is {0} is {1}",3,circ));
            Console.ReadLine();


            Console.WriteLine("Calling the WebService using a IoC Container, Ninject");
            IKernel container = new StandardKernel(new PiWebServiceModule());
            lib = container.Get<MathLib>();
            circ = lib.ComputeCircumference(3);
            Console.WriteLine(string.Format("The circumference of a circle whose radius is {0} is {1}", 3, circ));
            Console.ReadLine();
        }
    }
}
